package com.siyuanren.gcocp.dto.wx;

import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.siyuanren.gcocp.entity.WxUserChapter;
import com.siyuanren.gcocp.enums.wx.CourseChapterStudyStateEnum;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * @author guwr
 * @date 2018/4/12
 */
@Getter
@Setter
public class WxUserChapterDTO extends WxUserChapter {

    private String chapterName;
    private String teacherName;
    private String teacherImg;


    /**
     * 章节学习时间
     */
    public String getStudyTimeStr() {
        return DateUtil.format(getStudyTime(), "MM-dd");
    }

    public String getChapterStateStr() {
        return CourseChapterStudyStateEnum.getEnumDesc(getChapterState());
    }
}
